import { wxRequest } from "../../utils/httpRequest"
// import initComputed from 'wx-computed'
import utils from "../../utils/util"

Page({
    data: {
        steps: [
            {
                desc: '待下单',
                inactiveIcon: 'balance-list-o',
                activeIcon: 'success'
            },
            {
                desc: '确认中',
                inactiveIcon: 'todo-list-o',
                activeIcon: 'success'
            },
            {
                desc: '待收货',
                inactiveIcon: 'logistics',
                activeIcon: 'success'
            },
            {
                desc: '已送达',
                inactiveIcon: 'completed',
                activeIcon: 'success'
            }
        ],
        active: 1,
        orderId: "",
        orderDetail: null
    },
    getOneOrder() {
        let params = {
            orderId: this.data.orderId
        }
        wxRequest('getOneOrder', params).then((res) => {
            this.setData({ orderDetail: res.data });
            console.log(this.data.orderDetail);
        });
    },
    goShop(event) {
        wx.navigateTo({
            url: `/home_package/shopMeals/shopMeals?shopId=${event.currentTarget.dataset.shopid}`,
        })
    },
    onLoad(options) {
        this.setData({ orderId: options.orderId});
        this.getOneOrder();
    },
    onShow() {
    }
})